#ifndef __ATT_H
#define __ATT_H

#include "stm32f10x.h"                  // Device header
#include "gpio.h"

/******************************************************
衰减器  PB10 PB11 PB12 PB13 PB14 PB15
*******************************************************/

#define ALL_HIGH ((uint8_t)0x3f)
#define ALL_LOW  ((uint8_t)0x00)
#define V6_0_5dB ((uint8_t)0x3e)    //PB10
#define V5_1_0dB ((uint8_t)0x3d)    //PB11
#define V4_2_0dB ((uint8_t)0x3b)    //PB12
#define V3_4_0dB ((uint8_t)0x37)    //PB13
#define V2_8_0dB ((uint8_t)0x2f)    //PB14
#define V1_16_dB ((uint8_t)0x1f)    //PB15

union ATT_VALUE
{
    float    payload;
    uint8_t  buffer[4];
};

extern union ATT_VALUE ATT;

void ATT_Init(void);
void ATT_PinSet(uint8_t value);
uint16_t ATT_RatioSet(float value);

#endif
